package aliyun.cx.front.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 前端模块API控制器
 */
@RestController
@RequestMapping("/api/front")
public class FrontApiController {
    
    @GetMapping("/info")
    public Map<String, Object> info() {
        Map<String, Object> result = new HashMap<>();
        result.put("code", 200);
        result.put("message", "success");
        result.put("data", new HashMap<String, Object>() {{
            put("module", "demo_front");
            put("version", "1.0-SNAPSHOT");
            put("description", "前端模块 - 用户界面和前端展示");
            put("templateEngine", "Thymeleaf");
        }});
        return result;
    }
    
    @GetMapping("/config")
    public Map<String, Object> config() {
        Map<String, Object> result = new HashMap<>();
        result.put("code", 200);
        result.put("message", "success");
        result.put("data", new HashMap<String, Object>() {{
            put("title", "Spring Boot 3 多模块演示项目");
            put("version", "1.0-SNAPSHOT");
            put("description", "这是一个基于 Spring Boot 3.0.2 的多模块项目");
        }});
        return result;
    }
}
